/**
 * 
 */
package org.xserver.core.command;

import java.io.File;

import org.xserver.core.util.FileUtil;

/**
 * @author jkonopka
 * 
 */
public class FolderInitializeCommand implements ICommand {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4223780109225309726L;
	private final String folder;

	/**
	 * @param folder path to initialize
	 */
	public FolderInitializeCommand(String folder) {
		this.folder = folder;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jserver.command.ICommand#execute()
	 */
	@Override
	public void execute() throws Exception {
		final File file = new File(folder);
		if (!file.exists()) {
			FileUtil.createFolder(file);
		}
	}

}
